/*
@
@   Author: Buya
@	NPC = Sgt. Anderson
@	Map = Abandoned Tower
@	NPC Exit MapID = 221024500
@
*/

void npc(Player @player, NPC @npc) {
	int state = npc.getState();
	int map = player.getMap().getID();
	if(map == 922010000){
		if(state == 0){
			player.giveItem(4001022, -(player.getItemAmount(4001022)));
			player.giveItem(4001023, -(player.getItemAmount(4001023)));
			player.changeMap(221024500);
			npc.end();
		}
	}
	else{
		if(state == 0){
			npc.addText("Are you sure you want to leave #bLudibrium Party Quest#k?");
			npc.sendYesNo();
		}
		else if(state == 1){
			if(npc.getSelected() == YES){
				player.changeMap(922010000);
                                npc.end();
			}
			else{
				npc.addText("OK, Talk to me again if you want to leave here.");
				npc.sendOK();
                                npc.end();
			}
		}
	}
}